@echo off
echo 🚀 快速数据迁移到 MongoDB (Windows版)
echo.

echo 📦 正在编译 TypeScript...
call npm run build
if %errorlevel% neq 0 (
    echo ❌ TypeScript 编译失败
    echo 💡 请确保已安装依赖: npm install
    pause
    exit /b 1
)

echo ✅ 编译成功！
echo.

echo ▶️ 执行数据迁移...
node dist/scripts/migrate-to-mongodb.js
if %errorlevel% neq 0 (
    echo ❌ 数据迁移失败
    pause
    exit /b 1
)

echo.
echo 🎉 数据迁移完成！
echo.
echo 🔗 验证迁移结果:
echo   GET http://localhost:8080/v1/mongodb/connection
echo   GET http://localhost:8080/v1/mongodb/users
echo   GET http://localhost:8080/v1/mongodb/alerts
echo.
pause